package com.ssy.lingxi.marketing.api.fallback;

import com.ssy.lingxi.common.response.ResponseCode;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.marketing.api.feign.ActivityGoodsControllerFeign;
import com.ssy.lingxi.marketing.api.model.request.*;
import com.ssy.lingxi.marketing.api.model.response.CartActivityPriceFeignResponse;
import com.ssy.lingxi.marketing.api.model.response.GoodsCartResponse;
import com.ssy.lingxi.marketing.api.model.response.ProductTagResp;
import org.springframework.stereotype.Component;

import javax.validation.Valid;
import java.util.List;

/**
 * 活动商品feign接口降级实现
 * @author yzc
 * @version 2.0.0
 * @date 2021/9/2
 */
@Component
public class ActivityGoodsControllerFeignFallback implements ActivityGoodsControllerFeign {
    @Override
    public Wrapper<List<ProductTagResp>> listActivityGoodsProductTag(ProductTagReq req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<List<GoodsCartResponse>> listActivityGoodsCart(GoodsCartRequest request) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<List<ProductTagResp>> getPreferentialPrice(ProductTagReq req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<?> updateGoodsSales(GoodsSalesReq req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<List<CartActivityPriceFeignResponse>> getPreferentialPrice(@Valid CartActivityPriceFeignRequest request) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<Long> addGroupPurchase(GroupPurchaseAddRequest req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<Boolean> isRepeatJoinGroupPurchase(@Valid GroupPurchaseCheckRequest req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }
}
